package cn.test;

public class CreditAccount extends Account{
    private double ceiling ;

    public CreditAccount(long id, String name, String password, String personld, String email, double balance, double ceiling) {
        super(id, name, password, personld, email, balance);
        this.ceiling = ceiling;
    }

    @Override
    public void withdraw(double money) {//取款
        if(this.getCeiling()+this.ceiling>=money){
            this.setCeiling(this.getBalance()-money);
        }else {
            System.out.println("对不起，超出透支额度");
        }
    }

    public double getCeiling() {
        return ceiling;
    }

    public void setCeiling(double ceiling) {
        this.ceiling = ceiling;
    }


}
